<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	</head>
	<body>
		<h1 id="Element_Type_Configurations_for_UML_Profiles">Element Type Configurations for UML Profiles</h1>
		<p>For detailed information about the Element Types framework of GMF/Papyrus, see the Toolsmiths/ElementTypeConfigurationsFramework section.</p>
		<p>This section focuses on how Element Type Configuration models can be generated from a Profile, as well as maintained when the Profile evolves.</p>
		<h2 id="The_Element_Type_Configurations_model_for_UML_Profiles">The Element Type Configurations model for UML Profiles</h2>
		<p>The Element Type model generated from a UML Profile contains one SpecializationTypeConfiguration per Stereotype Extension, extending the UML Metamodel Type corresponding to the extended UML Metaclass. Each Specialization Type contains a Stereotype Matcher to identify the existing Stereotyped Elements, and an Advice to automatically apply the Stereotype on creation. Further customization (Such as setting some values during the creation of the Stereotyped Element, or attaching custom Advices) must be done manually.</p>
		<h2 id="Generating_the_Model">Generating the Model</h2>
		<p>The Element Type Configuration model can be generated by opening the profile in the Papyrus editor. From the Model Explorer view, right click on the Profile, and select Generate Tooling Model &gt; Element Types...</p>
		<p>
			<img border="0" src="images/Generate.png"/>
		</p>
		<p>This opens the Model Generation wizard:</p>
		<p>
			<img border="0" src="images/Generate_Wizard.png"/>
		</p>
		<p>In this wizard, you can select:</p>
		<ul>
			<li>The Identifier: used to prefix all identifiers in the Types model</li>
			<li>Base element types set: the element types to extend. For a Profile, this is typically the UMLElementTypeSet from the org.eclipse.papyrus.uml.service.types plug-in, which contains all the default types for UML. You may also choose the UMLDIElementTypeSet to generate specialized types for all visual (diagram) elements. This guide focuses on the default value, which is UMLElementTypeSet.</li>
			<li>Parent folder: Where the Element Type Configuration Model will be generated. It is recommended to select a folder inside of an Eclipse plug-in Project. In that case, the Generator will also configure the plug-in, to define e.g. all required plug-in dependencies, extension points, etc.</li>
			<li>File name: the file name for the generated model. The default value is usually a good choice.</li>
		</ul>
		<p>The options related to the incremental generation will be discussed in the next section.</p>
		<p>When pressing finish, the model will be generated at the selected location, and will contain one Specialization Type Configuration for each Stereotype Extension:</p>
		<p>
			<img border="0" src="images/GeneratedModel.png"/>
		</p>
		<h2 id="Incremental_Generation">Incremental Generation</h2>
		<p>Since the generated model only contains the simple structure for your Profile Types (Which may or may not be sufficient), it is often required to add custom Advices to the generated Specialization Types. If the profile evolves (Usually with new Stereotypes), the generator can be used to update an existing Element Types Model to include the Specialization Types related to these new Stereotypes, without affecting the existing Types. This way, the user changes will be preserved.</p>
		<p>Incremental Generation is the default behavior when generating the Element Types and selecting a target Folder/Model that already exists:</p>
		<p>
			<img border="0" src="images/Generate_Wizard_Incremental.png"/>
		</p>
		<p>The following profile changes will be considered by the incremental generator:</p>
		<ul>
			<li>New Stereotype or Extension: A new Specialization Type Configuration will be generated for each new Stereotype Extension (Either a new Stereotype with some Extensions, or an existing Stereotype with new Extensions).</li>
			<li>Removed Stereotype or Extension: All Specialization Type Configurations generated from a Stereotype or an Extension that has been deleted will be removed from the model, if "Removed Deleted Types" is selected. Uncheck this option if you wish to preserve the Specialization Types (Note that the resulting model will then be invalid, and will need to be fixed manually. This may be a safer choice if you made heavy customizations to the generated model; but is not recommended otherwise).</li>
			<li>Renamed Stereotype: Existing Specialization Types corresponding to Stereotypes that have been renamed will be updated to use the new (qualified) name. This includes Stereotype Matcher, Apply Stereotype Advices, Specialization Type ID and Name. Custom advices will not be modified. Renamed Stereotypes are identified based on their URI, as defined in the generated Specialization Type Configuration 'Source' attribute.</li>
		</ul>
	</body>
</html>